<?php
namespace app\wf\controller;
use \think\Db;
use think\Controller;
use \think\Request;
use \think\Session;
use app\common\controller\DirectoryPageBase;
class EntityUpdate extends DirectoryPageBase
{
	//保存节点属性
	public function index($param)
    {
     if($param['EnName']=="BP.WF.Template.NodeExt"){
		$data=Db::table('wf_node')
			->where('NodeID', $param['No'])
			->update([
				'TCent'  => $param['TCent'],
				'HungLab' => $param['HungLab'],
				// 'ThreadKillRoleTextText'  => $param['ThreadKillRoleTextText'],
				'OfficeBtnEnable' =>$param['OfficeBtnEnable'] ,
				// 'CCWriteToText'  => $param['CCWriteToText'],
				'RunModel' => $param['RunModel'],
				// 'DelEnableText'  => $param['DelEnableText'],
				// 'CCWriteToTextText' => $param['CCWriteToTextText'],
				'PassRate'  => $param['PassRate'],
				'WAlertWay' => $param['WAlertWay'],
				'IsEval'  => $param['IsEval'],
				'IsGuestNode' => $param['IsGuestNode'],
				// 'ReadReceiptsText'  => $param['ReadReceiptsText'],
				'PRIEnable' => $param['PRIEnable'],
				// 'PrintDocEnableTextText'  => $param['PrintDocEnableTextText'],
				'SearchLab' => $param['SearchLab'],
				'BatchEnable'  => $param['BatchEnable'],
				'WebOfficeEnable' => $param['WebOfficeEnable'],
				'JumpToNodes'  => $param['JumpToNodes'],
				'FocusField' => $param['FocusField'],
				'ConfirmLab'  => $param['ConfirmLab'],
				// 'ReturnOneNodeRoleTextText' => $param['ReturnOneNodeRoleTextText'],
				'OfficeBtnLab'  => $param['OfficeBtnLab'],
				'SaveEnable' => $param['SaveEnable'],
				'SearchEnable'  => $param['SearchEnable'],
				// 'CancelRoleText' => $param['CancelRoleText'],
				// 'ReturnRoleTextText'  => $param['ReturnRoleTextText'],
				'PRILab' => $param['PRILab'],
				'EndFlowEnable'  => $param['EndFlowEnable'],
				'ShiftLab' => $param['ShiftLab'],
				'ThreadEnable'  => $param['ThreadEnable'],
				'AutoRunEnable' => $param['AutoRunEnable'],
				// 'WhoExeItTextText'  => $param['WhoExeItTextText'],
				'ThreadKillRole' => $param['ThreadKillRole'],
				'SubFlowStartParas'  => $param['SubFlowStartParas'],
				// 'PrintPDFModleTextText' => $param['PrintPDFModleTextText'],
				'ReturnLab'  => $param['ReturnLab'],
				'CancelRole' => $param['CancelRole'],
				// 'ReadReceiptsTextText'  => $param['ReadReceiptsTextText'],
				'ThreadLab' => $param['ThreadLab'],
				'Step'  => $param['Step'],
				'AllotEnable' => $param['AllotEnable'],
				// 'HuiQianRoleTextText'  => $param['HuiQianRoleTextText'],
				'TrackEnable' => $param['TrackEnable'],
				'CCWriteTo'  => $param['CCWriteTo'],
				'DoOutTimeCond' => $param['DoOutTimeCond'],
				'CHWay'  => $param['CHWay'],
				// 'DelEnableTextText' => $param['DelEnableTextText'],
				'DTFrom' => $param['DTFrom'],
				// 'CCRoleTextText' => $param['CCRoleTextText'],
				'PrintPDFLab' => $param['PrintPDFLab'],
				'ThreadIsCanShift' => $param['ThreadIsCanShift'],
				'AutoJumpRole1' => $param['AutoJumpRole1'],
				'ShiftEnable' => $param['ShiftEnable'],
				'ReturnField' => $param['ReturnField'],
				'HuiQianRole' => $param['HuiQianRole'],
				// 'RunModelTextText' => $param['RunModelTextText'],
				// 'ReturnRoleText' => $param['ReturnRoleText'],
				// 'CancelRoleTextText' => $param['CancelRoleTextText'],
				'CCLab' => $param['CCLab'],
				'WhoExeIt' => $param['WhoExeIt'],
				// 'WhoExeItText' => $param['WhoExeItText'],
				'WorkCheckLab' => $param['WorkCheckLab'],
				'JumpWayLab' => $param['JumpWayLab'],
				'IsAllowRepeatEmps' => $param['IsAllowRepeatEmps'],
				'IsBackTracking' => $param['IsBackTracking'],
				'SubThreadType' => $param['SubThreadType'],
				'CCRole' => $param['CCRole'],
				'TimeLimit' => $param['TimeLimit'],
				// 'SubFlowStartWayTextText' => $param['SubFlowStartWayTextText'],
				// 'SubThreadTypeTextText' => $param['SubThreadTypeTextText'],
			    'ConfirmEnable' => $param['ConfirmEnable'],
				'ReturnReasonsItems' => $param['ReturnReasonsItems'],
				'DoOutTime' => $param['DoOutTime'],
				'SendLab' => $param['SendLab'],
				// 'CCRoleText' => $param['CCRoleText'],
				'TAlertWay' => $param['TAlertWay'],
				'AutoJumpRole2' => $param['AutoJumpRole2'],
				'EndFlowLab' => $param['EndFlowLab'],
				'ListEnable' => $param['ListEnable'],
				'FocusLab' => $param['FocusLab'],
				'WebOffice' => $param['WebOffice'],
				'ReadReceipts' => $param['ReadReceipts'],
				'SaveLab' => $param['SaveLab'],
				'DelLab' => $param['DelLab'],
				'IsBUnit' => $param['IsBUnit'],
				'WarningDay' => $param['WarningDay'],
				// 'SubThreadTypeText' => $param['SubThreadTypeText'],
				'TrackLab' => $param['TrackLab'],
				// 'JumpWayTextText' => $param['JumpWayTextText'],
				'SelfParas' => $param['SelfParas'],
				'ThreadIsCanDel' => $param['ThreadIsCanDel'],
				// 'JumpWayText' => $param['JumpWayText'],
				'JumpWay' => $param['JumpWay'],
				'OutTimeDeal' => $param['OutTimeDeal'],
				'PrintHtmlLab' => $param['PrintHtmlLab'],
				'Name' => $param['Name'],
				'AskforLab' => $param['AskforLab'],
				'IsTask' => $param['IsTask'],
				'HuiQianLab' => $param['HuiQianLab'],
				'PrintZipLab' => $param['PrintZipLab'],
				'AskforEnable' => $param['AskforEnable'],
				// 'CondModelText' => $param['CondModelText'],
				// 'CondModelTextText' =>$param['CondModelTextText'] ,
				// 'ReturnOneNodeRoleText' => $param['ReturnOneNodeRoleText'],
				'IsRM' => $param['IsRM'],
				// 'RunModelText' => $param['RunModelText'],
				'IsExpSender' => $param['IsExpSender'],
				'BatchLab' => $param['BatchLab'],
				// 'PrintDocEnableText' => $param['PrintDocEnableText'],
				'FlowName' => $param['FlowName'],
				'PrintPDFEnable' => $param['PrintPDFEnable'],
				'CancelDisWhenRead' => $param['CancelDisWhenRead'],
				'WorkCheckEnable' => $param['WorkCheckEnable'],
				'HungEnable' => $param['HungEnable'],
				// 'PrintPDFModleText' => $param['PrintPDFModleText'],
				'SendJS' => $param['SendJS'],
				'WAlertRole' => $param['WAlertRole'],
				'PrintZipEnable' => $param['PrintZipEnable'],
				// 'ThreadKillRoleText' => $param['ThreadKillRoleText'],
				'ReturnAlert' => $param['ReturnAlert'],
				'NodeAppType' => $param['NodeAppType'],
				'ListLab' => $param['ListLab'],
				'WhenNoWorker' => $param['WhenNoWorker'],
				'ReturnOneNodeRole' => $param['ReturnOneNodeRole'],
				'TAlertRole' => $param['TAlertRole'],
				'Tip' => $param['Tip'],
				'AllotLab' => $param['AllotLab'],
				'NodeID' => $param['NodeID'],
				'AutoJumpRole0' => $param['AutoJumpRole0'],
				'ReturnRole' => $param['ReturnRole'],
				'TCLab' => $param['TCLab'],
				'PrintDocLab' => $param['PrintDocLab'],
				'FK_Flow' => $param['FK_Flow'],
				'CondModel' => $param['CondModel'],
				'FWCSta' => $param['FWCSta'],
				'SubFlowStartWay' => $param['SubFlowStartWay'],
				// 'HuiQianRoleText' => $param['HuiQianRoleText'],
				'DTTo' => $param['DTTo'],
				'AutoRunParas' => $param['AutoRunParas'],
				'TCEnable' => $param['TCEnable'],
				'FocusEnable' => $param['FocusEnable'],
				'PrintHtmlEnable' => $param['PrintHtmlEnable'],
				'PrintPDFModle' => $param['PrintPDFModle'],
				'DelEnable' => $param['DelEnable'],
				'TWay' => $param['TWay'],
				// 'SubFlowStartWayText' =>$param['SubFlowStartWayText'] ,
				'PrintDocEnable' => $param['PrintDocEnable']
				// 'EndJSON' =>$param['EndJSON'] 
			]);
	  
			if($data>=0){
				//修改成功
				return 1;
			}else{
				return 0;
			}
	         
	 }
	
	}

	//保存节点名称
	public function Node($param){
		$num=Db::table('wf_node')
		->where('NodeID', $param['NodeID'])
		->update([
			'Name'  =>$param['Name'],
		]);
		return $num; 

	}
	//修改sys_groupfield,mapdata表中的节点名称
	public function MapData($param){
		$num=Db::table('sys_groupfield')
		->where('FrmID', $param['pkval'])
		->update([
			'Lab'  =>$param['Name'],
		]);
		$num=Db::table('sys_mapdata')
		->where('No', $param['pkval'])
		->update([
			'Name'  =>$param['Name'],
		]);
		return $num; 
	}
}
